/**
 * Created by jinglupeng on 2/17/16.
 */

function loadGroupOffset(group) {
    var url = "/group/" + group;
    return new Promise(function (resolve, reject) {
        $.get(url, function (resp) {
        }, 'json').done(function (resp) {
            resolve(resp);
        }).fail(function (error) {
            reject(error);
        })
    });
}

function loadGroups() {
    var url = "/group";
    return new Promise(function (resolve, reject) {
        $.get(url, function (resp) {
        }, 'json').done(function (resp) {
            resolve(resp);
        }).fail(function (error) {
            reject(error);
        })
    });
}

module.exports = {
    loadGroupOffset: loadGroupOffset,
    loadGroups: loadGroups
}